package com.gopay.common.domain.riskcontrol;

import java.util.Date;

import javax.persistence.*;

import com.gopay.common.cipher.utils.SensitiveInfoUtils;
import com.gopay.common.domain.BaseEntity;

/**
 * 
 * @author leixiaobao
 * @date 2016-07-28
 * 快捷银行卡快照表
 */
@Entity
@Table(name="RC_EXPAY_CARD_SNAPSHOT")
public class RcExpayCardSnapshot extends BaseEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	
    /**
     * 国付宝系统订单号
     */
    private String gopayOrderId;
    
    /**
     * 手机号
     */
    private String mobile;
    
    /**
     * 卡户名
     */
    private String bankAcctName;
	
    /**
     * 卡号
     */
    private String cardNo;
    
    /**
     * 银行名
     */
    private String bankCode;
    
    /**
     * 卡类型
     */
    private int cardType;
    
    /**
     * 卡有效期
     */
    private String creditCardExpired;
    
    /**
     * 证件类型
     */
    private String certType;
    
    /**
     * 证件号
     */
    private String certNo;
    
    /**
     * 乐观锁版本号
     */
	private int version;
    
   private String remark1;
    
    /**
     * 创建时间
     */
    private Date createdTs;
    
    /**
     * 修改时间
     */
    private Date updateTs;

    /**
     * 银行名称
     */
    private String bankName;

	/**
	 * 终端类型
	 */
	private String termination;

	/**
	 * 特殊渠道处理码
	 */
	private String specialChCode;

	/**
	 * 国付宝钱包新旧版本
	 */
	private String appVersionStatus;
    
	@Id
    @Column(name="GOPAY_ORDER_ID")
    public String getGopayOrderId() {
		return gopayOrderId;
	}

	public void setGopayOrderId(String gopayOrderId) {
		this.gopayOrderId = gopayOrderId;
	}

	@Column(name="MOBILE")
    public String getMobile() {
		//return mobile;
		/**
		 * modified by zyt 2017-4-10 自动重新加密并解密返回
		 */
		this.mobile = SensitiveInfoUtils.autoReencrypt(this.mobile);
		return SensitiveInfoUtils.smartDecryptWithCheck(this.mobile);
	}

	public void setMobile(String mobile) {
		//this.mobile = mobile;
		/**
		 * modified by zyt 2017-4-10 写操作的时候做加密
		 */
		this.mobile = SensitiveInfoUtils.smartEncryptWithCheck(mobile);
	}

	@Column(name="BANK_ACCT_NAME")
    public String getBankAcctName() {
		//return bankAcctName;
		/**
    	 * modify by zyt，在程序中获取的时候进行解密操作，如果是hibernate自己调用（save等），则返回原值；
    	 * 2017-1-5
    	 */
    	this.bankAcctName = SensitiveInfoUtils.autoReencrypt(bankAcctName);
		return SensitiveInfoUtils.smartDecryptWithCheck(this.bankAcctName);
	}

	public void setBankAcctName(String bankAcctName) {
		//this.bankAcctName = bankAcctName;
		/**
    	 * modified by zyt，判断传入字符串是否经过加密，如果是，则设置为原文，否则设置为加密后的值
    	 * 2017-1-5
    	 */
		this.bankAcctName = SensitiveInfoUtils.smartEncryptWithCheck(bankAcctName);
	}

	@Column(name="CARD_NO")
    public String getCardNo() {
		/**
    	 * modify by zyt，在程序中获取的时候进行解密操作，如果是hibernate自己调用（save等），则返回原值；
    	 * 2017-1-5
    	 */
    	this.cardNo = SensitiveInfoUtils.autoReencrypt(cardNo);
		return SensitiveInfoUtils.smartDecryptWithCheck(this.cardNo);
	}

	public void setCardNo(String cardNo) {
		/**
    	 * modified by zyt，判断传入字符串是否经过加密，如果是，则设置为原文，否则设置为加密后的值
    	 * 2017-1-5
    	 */
		this.cardNo = SensitiveInfoUtils.smartEncryptWithCheck(cardNo);
	}

	@Column(name="BANK_CODE")
    public String getBankCode() {
		return bankCode;
	}

	public void setBankCode(String bankCode) {
		this.bankCode = bankCode;
	}

	@Column(name="CARD_TYPE")
    public int getCardType() {
		return cardType;
	}

	public void setCardType(int cardType) {
		this.cardType = cardType;
	}

	@Column(name="CREDIT_CARD_EXPIRED")
    public String getCreditCardExpired() {
		/**
    	 * modify by zyt，在程序中获取的时候进行解密操作，如果是hibernate自己调用（save等），则返回原值；
    	 * 2017-1-5
    	 */
    	this.creditCardExpired = SensitiveInfoUtils.autoReencrypt(creditCardExpired);
		return SensitiveInfoUtils.smartDecryptWithCheck(this.creditCardExpired);
	}

	public void setCreditCardExpired(String creditCardExpired) {
		/**
    	 * modified by zyt，判断传入字符串是否经过加密，如果是，则设置为原文，否则设置为加密后的值
    	 * 2017-1-5
    	 */
		this.creditCardExpired = SensitiveInfoUtils.smartEncryptWithCheck(creditCardExpired);
	}

	@Column(name="CERT_TYPE")
    public String getCertType() {
		return certType;
	}

	public void setCertType(String certType) {
		this.certType = certType;
	}

	@Column(name="CERT_NO")
    public String getCertNo() {
		/**
    	 * modify by zyt，在程序中获取的时候进行解密操作，如果是hibernate自己调用（save等），则返回原值；
    	 * 2017-1-5
    	 */
    	this.certNo = SensitiveInfoUtils.autoReencrypt(certNo);
		return SensitiveInfoUtils.smartDecryptWithCheck(this.certNo);
	}

	public void setCertNo(String certNo) {
		/**
    	 * modified by zyt，判断传入字符串是否经过加密，如果是，则设置为原文，否则设置为加密后的值
    	 * 2017-1-10
    	 */
		this.certNo = SensitiveInfoUtils.smartEncryptWithCheck(certNo);
	}

	@Version
    @Column(name="VERSION")
    public int getVersion() {
		return version;
	}

	public void setVersion(int version) {
		this.version = version;
	}
	
	@Column(name="REMARK1")
	public String getRemark1() {
		/**
    	 * modify by zyt，在程序中获取的时候进行解密操作，如果是hibernate自己调用（save等），则返回原值；
    	 * 2017-3-3
    	 */
    	this.remark1 = SensitiveInfoUtils.autoReencrypt(remark1);
		return SensitiveInfoUtils.smartDecryptWithCheck(this.remark1);
	}

	public void setRemark1(String remark1) {
		/**
    	 * modified by zyt，判断传入字符串是否经过加密，如果是，则设置为原文，否则设置为加密后的值
    	 * 2017-3-3
    	 */
		this.remark1 = SensitiveInfoUtils.smartEncryptWithCheck(remark1);
	}

	@Column(name="CREATED_TS")
    public Date getCreatedTs() {
		return createdTs;
	}

	public void setCreatedTs(Date createdTs) {
		this.createdTs = createdTs;
	}

	@Column(name="UPDATE_TS")
    public Date getUpdateTs() {
		return updateTs;
	}

	public void setUpdateTs(Date updateTs) {
		this.updateTs = updateTs;
	}

	@Column(name="BANK_NAME")
    public String getBankName() {
		return bankName;
	}

	public void setBankName(String bankName) {
		this.bankName = bankName;
	}

	@Column(name="TERMINATION")
	public String getTermination() {
		return termination;
	}

	public void setTermination(String termination) {
		this.termination = termination;
	}

	@Column(name="SPECIAL_CH_CODE")
	public String getSpecialChCode() {
		return specialChCode;
	}

	public void setSpecialChCode(String specialChCode) {
		this.specialChCode = specialChCode;
	}

	@Column(name="APP_VERSION_STATUS")
    public String getAppVersionStatus() {
		return appVersionStatus;
	}

	public void setAppVersionStatus(String appVersionStatus) {
		this.appVersionStatus = appVersionStatus;
	}
	
}
